﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>For Lillian</title>
    <script type="text/javascript" src="http://static.connect.renren.com/js/v1.0/FeatureLoader.jsp"></script>
    <script type="text/javascript" src="jquery-1.4.2.min.js" charset="utf-8"></script>
    <style type="text/css">
        #xiaonei img
        {
            width: 50px;
            height: 50px;
        }
    </style>
</head>
<body>
<section>
<div id="xiaonei"></div>
</section>

    <script type="text/javascript">
        XN_RequireFeatures(["Connect"], function() {
            XN.Main.init("2766e4c97dd54148839cb3889b6cffa2", "/html/xd_receiver.html");
            XN.Connect.get_status().waitUntilReady(function(login_state) {
                if (login_state == XN.ConnectState.connected) {

                } else {
                    document.getElementById("xiaonei").innerHTML = "<a href=\"#\" onclick=\"XN.Connect.requireSession(function(){});return false;\">点击登陆</a>";
                }
            });
            console.log(XN);

            XN.Main.get_sessionState().waitUntilReady(function() {
                XN.Main.apiClient.friends_getFriends();
                XN.Main.apiClient.friends_get(function(uids, ex) {
                    console.log(arguments);
                    //                    if (!ex) {
                    //                        //成功获得调用结果result
                    //                        XN.Main.apiClient.users_getInfo(uids, [], function(users, ex) {
                    //                            if (!ex) {
                    //                                //成功获得调用结果result
                    //                                //console.log(users);
                    //                                var html = [];
                    //                                $.each(users, function(index, user) {
                    //                                    html.push("<img src=\"" + user.tinyurl + "\" title=\"" + user.name + "\" />");
                    //                                });
                    //                                //console.log(html);
                    //                                document.getElementById("xiaonei").innerHTML = html.join("");
                    //                            }
                    //                        });

                    //                    }
                });

            });
        });
    </script>

</body>
</html>
